<template>
  <div>
  <el-button plain @click="openDialog">
    Click to open the Dialog
  </el-button>

  <el-dialog
      v-model="centerDialogVisible"
      title="Warning"
      width="500"
      align-center
  >
    <TextInput placeholder="test" :clearable="false" :showWordLimit="false" :autofocus="false" :validateEvent="false" :style="{}" :runShow="true" id="123" v-model:value="inputValue" />
    <template #footer>
      <div class="dialog-footer">
        <el-button @click="centerDialogVisible = false">Cancel</el-button>
        <el-button type="primary" @click="centerDialogVisible = false">
          Confirm
        </el-button>
      </div>
    </template>
  </el-dialog>
  </div>
</template>
<script lang="ts" setup>
import { ref } from 'vue'
import TextInput from
    '@/components/form/components/input/TextInput.vue'
import { showDialogKey,setValueKey } from "@/config/app.keys";

import eventBus from '@/event/eventBus';
const centerDialogVisible = ref(false)
const inputValue = ref('')

function  openDialog() {
  centerDialogVisible.value = true
  let timer = null;
  timer = setTimeout(() => {
    //debugger;
    const currentDate = new Date();
    const formattedDate = currentDate.toLocaleString();
    eventBus.$emit("123_setValueKey", formattedDate);
    clearTimeout(timer);
  }, 10);

}

</script>
